//
//  UserListView.swift
//  icloud
//
//  Created by raymond on 2022/6/4.
//

import SwiftUI

struct UserListView: View {
  @EnvironmentObject var ds: DataSource
  
  var body: some View {
    List {
      ForEach(ds.model.result, id:\.id){ user in
        NavigationLink {
          UserDetail(user: user).environmentObject(ds)
        } label: {
          UserRow(user: user)
        }
      }
    }
  }
}

struct UserListView_Previews: PreviewProvider {
  static var previews: some View {
    UserListView().environmentObject(DataSource())
  }
}
